/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef HMSERIALIZATION_ERROR_H
#define HMSERIALIZATION_ERROR_H

#include <napi/native_api.h>

namespace json_error {
typedef enum {
    napi_param_number_error = 25,
    napi_param_type_error,
} napi_errno;

typedef enum {
    YYJSON_CREATE_STATE_FAILED = 15,
    YYJSON_CREATE_DOC_FAILED,
    YYJSON_MUT_WRITE_ERROR,
} yyjson_errno;

struct Napi_Error {
    const char* code;
    const char* msg;
};

void handleNapiError(napi_env env, size_t err);

void handleYYJSONError(napi_env env, size_t err);
}


#endif //HMSERIALIZATION_ERROR_H
